home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gpp-1_42.lha / g++-1.42.0 / make-links.g++ < prev    next >
Text File  |  1991-10-19  |  3KB  |  89 lines

  1. #!/bin/sh
  2. # Script to make links for GNU C++
  3. #   Copyright (C) 1988 Free Software Foundation, Inc.
  4.  
  5. #This file is part of GNU CC.
  6.  
  7. #GNU CC is free software; you can redistribute it and/or modify
  8. #it under the terms of the GNU General Public License as published by
  9. #the Free Software Foundation; either version 1, or (at your option)
  10. #any later version.
  11.  
  12. #GNU CC is distributed in the hope that it will be useful,
  13. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #GNU General Public License for more details.
  16.  
  17. #You should have received a copy of the GNU General Public License
  18. #along with GNU CC; see the file COPYING.  If not, write to
  19. #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. #
  22. # Shell script to create proper links to machine-dependent files in
  23. # preparation for compiling g++.  Also, files borrowed verbatim from
  24. # GNU CC have their links made by this program.
  25. #
  26. # Usage: config.g++ [vint] machine
  27. #
  28. # If make-links.g++ succeeds, it leaves its status in links.status.
  29. # If make-links.g++ fails after disturbing the status quo, 
  30. #     links.status is removed.
  31. #
  32.  
  33. if [ xx${DIR} = xx ]
  34. then
  35.     DIR="../gcc"
  36. fi
  37. if [ xx${CDIR} = xx ]
  38. then
  39.     CDIR="${DIR}/config"
  40. fi
  41.  
  42. progname=$0
  43. remove=rm
  44. make_directory=mkdir
  45. change_directory=cd
  46. hard_link=ln
  47. symbolic_link='ln -s'
  48.  
  49. #for Test
  50. #remove="echo rm"
  51. #hard_link="echo ln"
  52. #symbolic_link="echo ln -s"
  53.  
  54. borrowed_files="obstack.c obstack.h rtl.c rtlanal.c expmed.c explow.c \
  55.   fold-const.c optabs.c sdbout.c symout.c emit-rtl.c jump.c cse.c loop.c \
  56.   flow.c stupid.c combine.c regclass.c local-alloc.c global-alloc.c \
  57.   reload.c reload1.c caller-save.c final.c recog.c rtl.h rtl.def \
  58.   machmode.def real.h c-tree.h symseg.h recog.h regs.h \
  59.   hard-reg-set.h gdbfiles.h basic-block.h reload.h conditions.h \
  60.   output.h move-if-change stddef.h assert.h gvarargs.h \
  61.   limits.h typeclass.h va-i860.h va-mips.h va-pyr.h va-sparc.h va-spur.h"
  62.  
  63. borrowed_made_files="insn-emit.c insn-peep.c insn-recog.c insn-extract.c \
  64.   insn-output.c insn-flags.h insn-config.h insn-codes.h"
  65.  
  66. $remove -f config || $remove -rf config
  67. $symbolic_link ${CDIR} ./config 2>/dev/null || { mkdir ./config; $hard_link ${CDIR}/* ./config; }
  68. if [ ! -r ${CDIR} ]
  69. then
  70.     echo "$progname: unable to link \`${CDIR}'."
  71.     exit 1
  72. fi
  73. echo "Linked \`${CDIR}'."
  74.  
  75. while [ -n "$borrowed_files" ]
  76. do
  77.     set $borrowed_files; file=$1; shift; borrowed_files=$*
  78.     $remove -f $file
  79.     $symbolic_link ${DIR}/$file . 2>/dev/null || $hard_link ${DIR}/$file .
  80.     if [ ! -r $file ]
  81.     then
  82.         echo "$progname: unable to link \`${DIR}/$file'."
  83.         exit 1
  84.     fi
  85.     echo "Linked \`${DIR}/$file'."
  86. done
  87.  
  88. exit 0
  89.